///@file Truss2.h
///@brief Declaration of the class representing a truss element with 2 nodes
///@author Arnaud Duval
///@version 0.0
///@date 2010/02/26


#ifndef TRUSS2_H
#define TRUSS2_H

#include "Element.h"

///@class Truss2
///@brief Class defining a truss element with 2 nodes

///A truss element with 2 nodes, displacement degrees of freedom and 2 integration Gauss points
class Truss2: public Element
{
	private:
		///@brief Section of the truss
		double section;
		///@brief Length of the truss
		double length;
		///@brief Spatial dimension of element
		unsigned int dimension;
	public:
		///@brief Default constructor
		Truss2() : Element() {}
		///@brief Constructor specifying the nodes
		Truss2(Node*, Node*);
		///@brief Constructor with arguments
		Truss2(Node*, Node*, Material*, double);
		///@brief Destructor
		virtual ~Truss2();
		///@brief Update specific values of element
		void Update();
		///@brief compute nodal residual from nodal DOF increment
		void Equilibrate(const Vector&, Vector &, Matrix &);
		///@brief Compute displacements interpolation matrix at a given intgration point
		Matrix N(unsigned int);
		///@brief Compute strain matrix operator at a given integration point
		Matrix B(unsigned int);
};


#endif

